Added directional walls in order to prevent motion between two grid points.