Fix a bug and reformat, added gradient checking code, unregularized
learning is working.