Avoid temporary list
Added check for cmd line param