Added new line
Fixed index calculation & block overlapping.

Also removed remains of old code.