remove dependence on std=c++11
change motor program buffer to a list which can be sorted