updated documentation and fixed unary handling