added some changes to do random paths.