Addition of Rspec tests for problem1 and amendment to code to make it a class/method rather than input direct functions