Whitening implementation: first attempt