Finish calculation by days, bugs need to be fixed