ext calc with loop