This is UncleSam's project. I've made a few logic changes (comments included in the code) to try and help.