Making rotateBackground a global function