Changes to fulfill homework

Described function line per line and overall