homework #3 with updated question #2