Refactored structure.
Fixed input pin.
Corrected examples.