fixed some compilation errors, still not ready to compile