Fixed typo
Added matrix differentiation