Added sampling mode control