Added whitening, initial tests pass