added square wave option (properly done) for stimulus