fix all build errors, now need to make tests pass