adding code to change speed if using OSX