Water depth with instinct 2

Good afternoon all 

My instinct2  has the same barometer sensor as the G1 so iv been told. Im trying to make a water depth data field, but the simulator app crashes. I'm fairly new to monkey c could one of you experts read  it over and tell me where im going wrong 

import Toybox.Activity;
import Toybox.Lang;
import Toybox.Time;
import Toybox.WatchUi;
import Toybox.Sensor;

class valueView extends WatchUi.SimpleDataField {

    function initialize() {
        SimpleDataField.initialize();
        label = "Water depth M";
    }

     var x = Activity.getActivityInfo().ambientPressure;
     var y = ((x - 1013)/9.9) ; //1013 average sea level pressure Pr, h=(P-Pr)/(rho * g '=9.9') 
    function compute(info as Activity.Info) as Numeric or Duration or String or Null {
        return y ;
    }

}