First somewhat working version of runAllInterleavings function.