cleaned up ranking, works now linear and quadratic
implemented fun overloading