revise loop to skip minor condiction