added document generate method