I did not write the original code. I just prettied it up a bit.