FastDIM algorithm implementation