added sqlite3 functionality and database auto-insert