Got rid of window.doc. Doc is now passed through options