fix bug and add ig algorithm