if structure takes too much time