added function
for calculating x in y=m*x+n