Added database stuff in