Simple class for handling matrices