Fix insert bug by using generalized balance function
remove unused stuff