Inspect function

This addresses #953.