added first working version of class database with all the function relative to the first part