Displays the characters in order of promixity, with the most probable character first. Also refactored the code to greatly improve visibility.