Make use of 'getSize' function to determine the length of an array,
instead of hard-coded 'size' variable.