Matrix API(not optimized)