implemented hscan in fast way.