added some classes and functions