Implementing Dave Sexton's suggestion from the forum