Added longest sequence flag code.