Functions assorted functions written in C++