Yep, definitely want a subfunction :-)