Changed to use the variable which is passed in the rotate parameters to rotate based on.