Fix #1 by increasing weight until unique weight is found
Add --input and --output arguments