add Berkeley specific header; use getopt; minor lint