added polygon support