rewritten application. added offline database