updating ewald routine