add text input and output for matrices