documentation; improved interface; tests