add conditional measure output

This is replacing #210.