Finished up a working version