snake matrix