checkM function

Change input to matrix