removed unnecessary code in isEmpty()