Added comments and description to functions