working on databse functions
Fixing merge issues