Added whiten parameter and tests