Fixed bugs; added new methods