finalized xcos parsing