changed hashing function and restructured Main.hs