better wrapping management. Fixes #3