minor improvements to variable names and comments
bind valid conditions function to this