if you have *any* ideas of how to reduce the size of this code, I'm all ears.