converted to storing number and using long array