Added a bunch of functionality. Enjoy.