student should use malloc for arrays