Replaced numbers with constants and added initial seed parameter.