Got SAD working in C++