completed assignment

The file includes also extensive comments. I adapted also the variable
naming in the hope that this way it would be easier to understand what
happens