added the 'dig' function