Add polar code to the lot.
Fix input file such that filter script doesn't barf at the end, over incomplete lines.