first version of gift wrapping algorithm