Added format string for start fresh line and fixed logic in previous function