major loop bug (fixing...)