adding Database and some changes on pervious files