changed sobel function to accept hash parameters.