Adding first reworked version

Moved from the donor and refactored to be more flexible.