ranking calculation fixes