defined plotArray functions globally