finished inputMove, could still be optimized more