removed cout
removed pow
switch from .at() to []