refactored randomize function to add overall rot