Added dynamic array sizes and array filling method via parameters