refactoring
X position transition bug fixed when mouse is moving