made a roundabout, but fun, solution to problem 4