fixed for statement that doesn't loop