change light duration calculation