read, customDocument and main class