wrote xToN.cpp. need to look at lifecycle.cpp