document control panel and main application code thoroughly