Created a can_fold function, moved most checks there