my assignment; added further commenting