Improving color detection algo