Threw in a tiny memory optimization here.