completed matrix code