Matrix Enhancement to allow different input types