implemented some methods in main_database