endless loop and nicer formatting