Implement most of the functions of the NAME stack