Beginning to implement database functionality in main