Finished coding main classes and DB connectivity