minor changes in format_entries function()