Fixed bug with pointers pointing to removed values, added struct element instead of using arrays