Better version of bin heap working