fixed a horrible bug in the regulariser code