added database implementation