added ParsePrimary function skeleton