Added some functionality. Fixed some bugs. meh.