Finished the improvement & fixed compiling.