new code for database