I think you don't have to place for loop here. Only need loop for L147-L154.