Now takes an integer array as an argument instead of a hard-coded one.