setup function now returns an int