updates for the coding convention and rebased with the current master. This should supersede syjun/rng