added math utils and convert to mapspan and position