* use actual document size instead of storing in variable each time is needed