Added new test code and getopt