cylinder class implementation