add some comments in the code, start implementing the point to surface distance calculation function