Refactoring using Simon Chan suggestions.  Still doenst work.  :-(