completed problem #6