Second part of homework