added database and improved previous files