new bubble size algorithm