First cut at base code