fixed swapped function args in demo code