Modified more cleverly