trying to solve probelm 3