solution 2 - still needs tests