ok, now it works. some extra optimization