loop and format tweaking