First attempt at generator, very rough