added tests and first version of generator