Added code for spinning