new DB structure

updated the functionalities