Added forward and backward substitution methods