my solutions to rally, problem 1