added emin and emin_scale as input arguments