added gradients and other things