updating matrix code