replaced loop/withs