seed added, fixed when length is first argument & variable names more descriptive