Added ability to send an array instead of a hashtable as the optional parameter