added isEmpty method to collection class