added choosing function