updated code to dynamically change cell background colors