Implemented random node sampling and command line parsing.