array solution corrected