use helperfunction in main