Added more methods and fixed minor bugs.