There are actually a couple of scripts or UDFS that deal with this as well.