Added functions to control LEDs via PORTA. Fixed timing bugs.
Working program.