split C++ part to guraif.cpp
implemented prototype