beta search done. unique pointers done.