Updated how the database library works