Code with Flashing
Final Working Code!

With extensive commenting :)