changes added to fit custom pulse generation