*finally fixed the memory leak and improved how the newlines are created inside objects (needs further testing)