rearranged the routines, making polar mapping available for other usages