ElementWise class implementation