That's a good idea, I was pretty unsatisfied with this code, but your suggestion would trim it down a lot