Some help from asciiphil in making my id sampler a little more readable