Added error computing for output nodes and added the sigmoid functions.