added database and unit tests