fixed shape for counting output
fixed handling the selected option correctly