made changes to fix compiler errors - still untested.