rename opts to getopt, add comments