adding in ability to pass in document