- updated documentation & some error checks