added generator

Fixed #3