added  support to generators, closes #4.