cleaned up function returns, and useless functions.