updated to use variables passed through topdoc