Quickly hacked it all together. Very messy, but solidish start