@SupressWarnings added for unsafe casts
New algorithm for color ranking (WIP)