Reworked to use a voltage regulator, added reverse protection diode, other improvements.