Second part of homework #2.