Cleaned, documented. Added -q flag.