simplify gift-wrapping algorithm