started a function to collect arrays from the squares diaganol