add documentation for compute function #276

Added import statements to docstring.