added isScalar and documentation