Fixed linked-string problem

And made the code more nice :)