DATABASE WORKS

Minor chanes and now it works.