1. Remove array initialization. This way creates extra empty element in it. Need to find better way to doing so.    2. Looks like there are many awk implementation which do not work in the same way in terms of syntax on other. I added comment on which awk version this works as expected.    3. Implementrd sorting using system sort utility. Give up with simplementing sort in awk.
Removed - Time to compleate.