Fixed formatting of splitArray function