implemented Fdscan algorithm, must be checked