almost done for bandwdith algo.