Math with fragments and DB