enabled multi thread
added more directions, some bug fix