Bugfix:
Due to Shared Memory size limitation of 109*109 the line length is limited. Now the linelength is checked bevore setting it.
speedup analyzis due to optimizations