use sg library
Merge pull request #1 from timsegraves/master

use sg library