Adding some stuff for surface calculation