enlarge size of array
add test cases
understood wrong meaning about question, change logic for process