Updated Document.__init__ to use variables already set rather than re-accessing values