matrix first 3

cpp only