refactor expand_to_quotes, add commets, #23