BUGFIX
Fixed off by 1 logic error