working much faster for the forward case. need to rewrite the backward case to match.