random int function implementation
fixed spacing to make jslint happy