Corrected colour logic, cleaned up code