Printing just the needed bits, need to propagate the bits from the previous node.
Fixed the problem duplicating the last point.
Need to fix getIndex when the number of bits is bigger than 8.