Add gauge function

First attempt at a gauge function