my helper function