initial commit for SGS4G, Includes all of bhundven/m4xm4n's changes that were in the first attempt