added bi-directional calculation sample