a big cleanup; fixed bug with empty argv