Changed foldLeft from abstract class to concrete class