added printMatrix and new implementation of volumeOverlap