fixed how to do a loop