fd off by 1 error; use better var name