added a few functions, changed to an abstract class