modified parseDocument method & added comments