Fix bugs, optimize and is ready for the benchmark