fixed scanner to use c++