Added code to throw IllegalArgumentException when input is negative