fixed sqr wave problem with set