This is your final code.

(spoon-feeding code removed by KevinWorkman)