Problem 1 refactor and added problem in comments