first 2d one way functioning implementation