my matrix function