[WIP] Adding Implementation of SAG

An implementation of SAG