added throwing exceptions; updated docs