define the new coordinate system and new algorithm