added headnode create and delete functions

merge head node code into devel