Updated query

Updated database query and "Fixed" rankings
Merge pull request #101 from Lerogero/master

Updated query