Implement expand

Implementation of expand, closes #127.
It's probably better to not line up the `=>`.  I think that's more idiomatic.