adding gradient check for back propagation (from Coursera Machine Learning course by Andrew Ng)