Updated Database file, added session functions