add examples; fix swap syntax