C++ code from uni