refactored the constituent square position logic