finally got sine wave working