reformatted and made stuff into loops