converts between arrays and poly lists