Initial C++ program

fix seg fault
Merge pull request #8 from MattDeanMPhys/Matt

Initial C++ program