renamed functions, combined Engine.hs with Types.hs