made the math to get the coordinates right work