optimized the x coordinates range