fixed outOfBounds error using Integer
made ArrayList static ie global fixed CPU indexing 0 issue