preliminary implementation of pulse generator