Backprograpation implemented + output written to file