rewrite with R6 start
rewrite with R6 stage 2. Code for RDML core is MUCH shorter. Works 3-4 times faster!!!