added variables to change speeds
added speed logic