moved the ranks func to its own file, tests also moved