Changes:
Added some comments and changed call by values to call by references.