Changed to use malloc/free for large arrays