added pulse mode, thx aaron