HW2 updated

1. defined n<- nrow(X), Adam did not define this in his code.
2. Force X to be a matrix in case it is a data frame since Data frame
will mess up the weight matrix