fixing some bugs, implemented Base Class