modified read_resm to loop through rows and columns of saveResPar
check for uniqueness and emptiness in read_resm
removed function-end -s to avoid nesting of subfunctions