Now it works

More or less a completely new approach at parsing the logic. And it works.