Added javadoc comments and added a test and refactored the validityCheck of the row and column.