New merge function. Replaced [] with array() for PHP 5.3