Added a stringify function to alter how arrays are put together for the query