Added nopt and added version argument