refactored matrix update matrix
added matrix premultiply