Fixed bugs, network now learns properly, however won't compile on gcc