updated prepareData
Added genModelData, extractData
Added function for generating pairwise network info
added genXandWX