Added changes from ElementalX

Added new changes/code from ElementalX kernel.