turned is_occupied into a method