Completed autofocus implementation.