improve triangle wave