hand merged some fixes and formatting changes from plumzi
replaced untz withh Plumzi's version