Based off the neural net tutorial on ai-junkie.com, though somewhat modified