Added command line argument handling. Not quite working because of problem with infinitne type lists