adding debug mode, working rankings