change size of the container
fix off-by-one error