changed comparator for passage term and fixed Nan