added resource() function documentation