move geocalc into typescript file