Changed the background colors and released allocated resources