fixing getmotion

added for loop to getmotion