made bg-color change gradual, organized code