implemented a basic matrix product