manage negative value for n