calculating error at output nodes implemented