Improved code structure and documentation. Added -r option.