Changed int's to doubles in order to allow smoother movement control