Added Documentation / Variable names conform with Spec

I have added annotations to the code and I have renamed the variables to fit in with the best practice for coding that we agreed on.