initial modifications to provided source: added header comments and got g++ compilation working