problem 5 done
little smarter on pb5