add tests, implement iterations, separate out hash functions from command line code