many.many algorithm changes,  also new functions