Simplifications, added more methods, implemented test().