Update for rust master
Implement polygon mode