Added gradient option

Added gradient option

Fix wrong default value