changed time to take chains into account