Using abstract classes with functions