keep the critical funtion definition