some improvements, and change input as OnMoved