changed autofr routine a little