moved calculations from beforedrivefragment to activity