Added some printfs to the UI. Took care of the memory leaks.