begening of bandwith calculation