homework for safearray and stack