query pin state - write
refactored to convert ugly cond statement to multimethods