Fix bugs
Refactor main.hs
little things