modified findSame