incorporated 3D binary matrix thing from Rama's code into fullmsa.py