Ensuring the matricial form of input