reformating of loops