implementation of classes functions