bug fixes off-by-one error and first expands min