made all backgrounds work and cleaned up resources