Modified API to Schoon's suggestion. Updated docs.