Sine tested and works

Some more cleanup too