[code] add loading support, add better random support, more comments