working version - adds cmd line args