Started adding DB functionality