primal parsing function added