Basic functionality implemented. See TODO.