Added initial gradient code