second attempt- added more comments