master
//TODO: this is likely inefficient and can be refactored to avoid loading the document multiple times