added input capture for encoder