Started to optimize krnextgen and rad modules. Optimized demultiplex function.