Added gradient flag

It works for now. Will revisit flags from a core level later (depending on the response from everyone).