Are you possibly misunderstanding what the code is suppose to be doing? As you mentioned the code is checking to make sure the space next to it is empty. If it's got something next to it then it does...