fixed off by one bugs in graph and added labels
fixed off by one bugs in graph and added labels