Use fromMaybe instead of fromJust
Use unzip instead of map fst, map snd