work on analyzing arbitrary pathways and conversion from/to matlab