Altered:
- I removed an unnecessary variable (it was supposed to be 0 and x+0 is
obviously not necessary) and fixed a check where the size was being
miscalculated by one (used the last index instead of size!).
- Some small code cleanup, like removing unnecessary comments.