added find longest profix