Added a bunch of methods and bug fixes