adapting to new scheme
cope with zero division error