adding DB functionality -james