Improved kernel to make structure energy minimizing real.