Added new methods and fixed bugs