refactored, relicensed, began #1 (needs research + testing)