Added usage information and fixed bugs
Minor style changes