isIn function works properly, but movement still to be corrected