have a bug or two to fix, but fixed one major one (1. forgot to take the transpose of a vactor after differentiation; 2. initialized w to random, not 0)