Added Database logic.