Added Problem 18, refactored the code, added .gitignore.