Total prototype, cowboy coded at a conference. TODO: Add tests!