New declarations for functions setItem(s) were added. Now dynamic memory allocation works properly :D