a more complete example with data. type classes to come next.