trying to use dictionary instead of an array