fixed the compile bugs, now need to track down errors.