Actually it's not my code... it was mamueller who wrote it.

I have already in mind to rewrite the comments, furthermore some parts are not very polite.