adding final part of homework