I'm sure a lot needs to be done to make this nicer, but it's working!