adding new function: adherence calculator version three