wrote range conditions into period determination factory