many many bugs fixed.  now compiles.  main() not filled out yet