added a bunch of stuff to make it actually work.