added data classes and database access code