compilation now works.  Needs testing