wrote atosurf-functions