add dimension checking, and subtraction operation