change if statement for days calculation