assorted c++ code...