db init file and function complete