Sine.cpp converted for smart pointers