ranking and logic fixes