Might need a few modifications for flashlight coding.

Schematic: