added memory deallocation methods
parsed types into data structures and added print method