Fixed some of the more obvious problems with xi, continues to elude, however