updated logic and colors