Now calculate energy J, fixed calculation of h, added alternative update strategies