Updates to database functions, started work on task 3