Add backward computation and related tests