fix all compiling errors, ready to debug