chenged main script to use new Database interface