stole clements code and implemented triangle wave
stole clements code and implemented triangle wave