Implemented evaluate in Term class