Added flow variables to devices. Added path matrixes operations