Graph drawing from array woes. (SOLVED)

The only problem is that I can't draw the lines in case 2.

And you STILL haven't explained what ACTUALLY happens. I give up.