Improved Explode algorithm