localize matrix stuffs