invented a new database class
some code rework for session code