Added option to set energy threshold and updates