added parsing for newlines for smoother printing