remade Bubble function into proper anonymous function