I do not relly like to have this loop before you start.
Do you think its possible to do everything in one loop (also pease add type checks for the kernel lists)