Working version with fragments.