added color comparison and debugging code