add option to choose task priority function