for bitman sake
some love for theory
add some substance to main
cleanup - take care of edge conditions
more robust program to remove duplicates