added change direction function to motors