Modified list add function to accept arrays of list items