Added PathMatrix

PathMatrix + some minor changes