Adding a method for checking if a list is empty.