make generator for directory work again
introduce definitions
deleted unneeded code
definitions need to be introduced here as well
fixed example