Implementation of the Generator Class