```random.nextInt(1)``` almost certainly doesn't do A Good Thing. It will actually always return 0 (the only *integer* that is at least 0 and strictly less than 1). You presumably want a random floating point value rather than a random integer.