Fixed case mismatch problem; used else clause to make loop breaking pythonic; made character checking O(1) instead of O(n)
Merge pull request #3 from victorakabutu/master

Fixed case mismatch problem and made other code improvements