implementation of abstract datatypes