seperate matrix related class to the new package