added data classes
changed acess to open/close each time
some other stuff