added NaN test for check_matching_sizes
added doc in code for check_matching_sizes