initial version from deckard-gradel