added some generic code