add loc and trying to simplify program.hs