Public methods added. Critical fixes. NOT TESTED PROPERLY