added comments to functions and classes