added a bunch of functions and stuff; it should be functional now