A little sloppy but it is working...