Updated version.  Seems to work