class implementation