crappying center point finding function added