Building a single layer neural network