Include proper calculations in getLocation