See the hunk below. Open to suggestions on improving it :)