got rid of memory leak in reval and added backward copy propagation