prob 5 SOLVED VERY INEFFICIENTLY