Improves random background function