Updated query

Updated database query and "Fixed" rankings