Final, working code
Final, working code