replaced the shareArray with a ArrayList from the collection framework