added functions and key commands to sine wave thingie