some stylistic changes, and fixing to new auto rand api