Working on getting stuff to compile.  Added lots of casts.