Debugged makeSine function