add correct code from swan