Neural network from scratch