need to make row modular to work in circular array.