improved AutoIndentation
improved rep sample, fixed crash