Problem 1 tested with jasmine-node