add array loop with 3 function