cleaned up poly code