added document wrapper methods and tests