re-based patch for google code site to address issue #146

needs to be tested