added cats and hats alternative solution