calculation for frames