#92 user memory deallocation added, code refactored #102 small changes