simple ranking algorithm