standard RHT main() implementation