Added option to set return type to assoc array