add connecting to database, and __main__.