Replaced in / out arrays by ArrayList to facilitate add / remove operations