automatic selection of best sigma programmed
minor changes
variable sigma code undone