Add comments

Added comments to helper and library functions.