mostly added commentary to code