fixed up map controller, moved haversine function to external class/module