figured out newlines, code cleanup