basic implemantion of 1-error search