Streamlined the custom code a little bit.