Update p108 to be faster/cleaner for c++ code