Adding solution to #6