Changed 'method' to 'function' in the docs.