Solved problem 3, added make file, refactoring