finally got gradient checking to pass