Added valuecheck function to prevent either blank or all the same values being passed back