Fixed major bug in subsurface calculation