Solved Problem 2 and refactored to lib
Updated gitignore