Code Structure Advice

I definitely see the improvement with the if statements. And I see what you mean about the substring and single digits but I've been using pins 22 - 53 with no issues.