faster version. This version should be bug-free. The speed is much faster than former version.

Signed-off-by: ezheng <ezheng@cs.unc.edu>
regular check

Signed-off-by: ezheng <ezheng@cs.unc.edu>
regular check. This version is correct and faster

Signed-off-by: ezheng <ezheng@cs.unc.edu>