modified for compilation.  It should be ready to go.