working on a functional implementation.
More functional stuff.