Solutions for homework assignment #4