First version. Basic functionality, but working