changed more functions to work with classes
Added delete function
removed structs