Fixed wrap around x axis bug