fixed off by one error on graphs