Changing rec structure, adding return types, adding checking for C++ compiler