added calculation of ideal for given day