added const to multiplication, and at(i,j) for indexing