cleaning up pcat_interface.py and documenting it