added static and typedef
removed headstack
fixed conflicts