Changed arraylist to just array to multipling with threads  will be
easier