A bidirectional formulation for Walk on Spheres