added a reflect parametre to motion functions