Making repeat configurable through the parameters passed in.

I add "repeat" as a parameter to the initialize function for Pulse. This allows it to be configurable, and if not specified it defaults to 3.