created a more robust size() method that counts the data structure each time.