Exploding array function