Adding constructor, isEmpty and toString methods