added autofocus and changed structure