Initial working implementation

Basic, but gets the job done!