logic diagram, first attempt