Vectorize back prop