included javadoc for random() method. also tweaked method slightly