added func. added fragment`s logic