basic implementation of matrix