change loop to correspond to interval covered by ABC pattern