boundary needs to be minus 1