Added isEmpty and contains methods