added squarewave