Added cond and extracted npos