modify some function wich output array. and correcting some comments