modified from https://code.google.com/p/wrtbwmon/