Added 'elementwise' function and a test case.