Efficiency improved

Some performance tweaks and coding simplifications applied.