Copy of https://github.com/kazewong/flowMC/issues/113
Copy of kazewong#113