fixing some functions in Main.hs