Adding part of plagiat
Awful govnocode, forgive me, Matz