added isEmpty method