atoi: add overflow handling
initial commit for matrix pattern