added dealing functions