Update sgb.cpp