Add unit test and readjust the row and column order in function parameters
add unit test