calculation of x value corrected