Bug fixes, refactoring, new rankings