replaced opposites from [] to ArrayList