minor modifications for NEST script