prob 7, better design