Whiten file slightly generalised