Updated for use with multiple documents