first cut at swaps code