first function pulled out of createSine