added isOccupied method