begin implement of custom matrix