working with default factory; bug pending to use my own
first version working more debugging needed